#define _CRT_SECURE_NO_WARNINGS
#include "list.h"
void test1()
{
	mh::list<int> l;
	l.push_back(1);
	l.push_back(2);
	l.push_front(3);
	l.push_front(4);
	l.pop_front();
	l.pop_back();
	mh::list<int>::iterator it = l.begin();
	while (it != l.end())
	{
		cout << *it << " ";
		++it;
	}
	cout << endl << l.size() << endl;
}
void test2()
{
	mh::list<int> l1(3, 1);
	mh::list<int>::iterator it = l1.begin();
	while (it != l1.end())
	{
		cout << *it << " ";
		++it;
	}
	cout << endl;

	mh::list<int> l2(l1.begin(), l1.end());
	mh::list<int>::iterator it2 = l2.begin();
	while (it2 != l2.end())
	{
		cout << *it2 << " ";
		++it2;
	}
	cout << endl;

	mh::list<int> l3(l1);
	mh::list<int>::iterator it3 = l3.begin();
	while (it3 != l3.end())
	{
		cout << *it3 << " ";
		++it3;
	}
	cout << endl;
	//l3 = l1;
	//it3 = l3.begin();
	//while (it3 != l3.end())
	//{
	//	cout << *it3 << " ";
	//	++it3;
	//}
	//cout << endl;
}

void test3()
{
	struct  Point
	{
		int x;
		int y;
		Point(int x = 0, int y = 0)
			:x(x)
			, y(y)
		{}
	};

	mh::list<Point> lt;
	lt.push_back(Point(1, 1));
	lt.push_back(Point(2, 2));
	lt.push_back(Point(3, 3));
	mh::list<Point>::iterator it = lt.begin();
	while (it != lt.end())
	{
		cout << it->x << " " << it->y << " " << endl;
		++it;
	}
	cout << endl;
}
int main()
{
	test3();
	return 0;
}